package com.liuceng.zen.service;

import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.ZoneId;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.task.TaskExecutor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.liuceng.zen.mapper.GdtRptCampaignDailyMapper;
import com.liuceng.zen.pojo.domain.GdtRptCampaignDaily;
@Service
public class GdtRptCampaignDailyService extends BaseService<GdtRptCampaignDaily> {
  private static final Logger LOG = LoggerFactory.getLogger(GdtRptCampaignDailyService.class);

//  @Autowired
//  private GdtCampaignRptClient rptCampaignDailyClient;
//  @Autowired
//  private GdtCampaignService gdtCampaignService;
//  @Autowired
//  private GdtCreativeService gdtCreativeService;
//  @Autowired
//  private GdtAdGroupService gdtAdGroupService;
//  @Autowired
//  private RptMemberCampaignGdtMobileDailyService rptMemberCampaignGdtMobileDailyService;
//  @Autowired
//  private RptMemberCampaignGdtPcDailyService rptMemberCampaignGdtPcDailyService;
//  @Autowired
//  private PcDataService pcDataService;
//  @Autowired
//  private MobileDataService mobileDataService;
//
//  @Autowired
//  private TaskExecutor taskExecutor;
  @Autowired
  GdtRptCampaignDailyMapper gdtRptCampaignDailyMapper;
  
  public List<GdtRptCampaignDaily> findByMemberId(Integer memberId,Date rptDate){
    LocalDate startRptlDate = rptDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
    Map<String, Integer> map =new HashMap<String, Integer>();
    map.put("memberId", memberId);
    map.put("rptYear", startRptlDate.getYear());
    map.put("rptMonth", startRptlDate.getMonthValue());
    map.put("rptDay", startRptlDate.getDayOfMonth());
    return gdtRptCampaignDailyMapper.findByMemberId(map);
  }
}
